package com.pubinfo.passbook.data.quartz.task;

import com.pubinfo.passbook.common.entity.TContractWriteoffHeader;
import com.pubinfo.passbook.common.service.contract.TContractWriteoffHeaderService;
import com.pubinfo.passbook.common.service.master.TWiteoffInstanceService;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Slf4j
@DisallowConcurrentExecution //作业不并发
@Component
public class SyncGetContractInstanceStatusJob implements Job {

  @Resource
  TContractWriteoffHeaderService writeoffHeaderService;

  @SneakyThrows
  @Override
  //定时获取账单状态
  public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
    writeoffHeaderService.getWriteoffInstStatus();
  }
}
